﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

namespace Wicresoft.EVM.Reporting
{
    public partial class Auth : System.Web.UI.Page
    {
        private static readonly string ErrorPageUrl = Util.ErrorUrl;
        private static readonly string DefaultPageUrl = Util.WebsiteUrl;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected string GetNavigationUrl()
        {
            string sid = Request.QueryString["sid"];
            
            if (sid == null)
                return ErrorPageUrl;

            if (Util.TryAuthenticate(sid))
            {
                return DefaultPageUrl;
            }
            else
            {
                return ErrorPageUrl;
            }
        }
    }
}